﻿namespace Material.Mvc.Models
{
    public class WeatherViewModel
    {
        public double Latitude { get; set; } = 31.2304; // 默认经纬度
        public double Longitude { get; set; } = 121.4737;
        public List<WeatherForecast> Forecasts { get; set; } = new List<WeatherForecast>();
        public string SessionId { get; set; } // 存储 SSE 会话 ID
        public string WarningColor { get; set; }
        public string Warning { get; set; }
        public string LocationName { get; set; } // 地点名称
        public List<LocationCoordinate> SavedLocations { get; set; } = new List<LocationCoordinate>();
    }

    public class WeatherForecast
    {
        public DateTime Date { get; set; }
        public string Weather { get; set; }
        public double Temperature { get; set; }
        public double FeelsLike { get; set; } // 体感温度
        public int Humidity { get; set; } // 湿度
        public string WindDirection { get; set; } // 风向
        public double WindSpeed { get; set; } // 风速
        public int AirQuality { get; set; } // 空气质量指数
        public int UVIndex { get; set; } // 紫外线指数
        public double Pressure { get; set; } // 气压
        public double Visibility { get; set; } // 能见度
        public string WeatherIcon { get; set; } // 天气图标
    }

    public class LocationCoordinate
    {
        public int Id { get; set; }
        public double Latitude { get; set; }
        public double Longitude { get; set; }
        public string Name { get; set; }
        public DateTime CreatedAt { get; set; }
    }

    public class WeatherApiResponse
    {
        public bool Success { get; set; }
        public string Message { get; set; }
        public WeatherData Data { get; set; }
    }

    public class WeatherData
    {
        public string Location { get; set; }
        public List<WeatherForecast> Forecasts { get; set; }
        public CurrentWeather Current { get; set; }
    }

    public class CurrentWeather
    {
        public double Temperature { get; set; }
        public double FeelsLike { get; set; }
        public int Humidity { get; set; }
        public string WindDirection { get; set; }
        public double WindSpeed { get; set; }
        public int AirQuality { get; set; }
        public int UVIndex { get; set; }
        public double Pressure { get; set; }
        public double Visibility { get; set; }
        public string Weather { get; set; }
        public string WeatherIcon { get; set; }
    }
}
